package summer_vacation.xuejiahua;

/**2.	编写一个字符界面的JAVA Application程序，接受用户输入的10个整数，比较并输出其中的最大值和最小值
 * Created by Administrator on 2015/8/22.
 */
import java.util.*;
public class Assignment_2{
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入10个任意的整数:");
        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < 10; i++)
        {
            int j = in.nextInt();
            if (min > j) min = j;
            if (max < j) max = j;
        }
        System.out.println("最大值为" + max);
        System.out.println("最小值为" + min);
    }
}
